using System;
using System.Runtime.Serialization;
using System.Security.Permissions;


namespace FinlogiK.FxCop.Statistics
{
	/// <summary>
	/// The exception that is thrown when an empty string or collection is passed to a method that does not accept it as a valid argument.
	/// </summary>
	[Serializable()]
	public sealed class ArgumentEmptyException : ArgumentException
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="ArgumentEmptyException"/> class.
		/// </summary>
		public ArgumentEmptyException()
			: base()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ArgumentEmptyException"/> class.
		/// </summary>
		/// <param name="parameterName">The name of the parameter that caused the exception.</param>
		public ArgumentEmptyException(string parameterName)
			: base(null, parameterName)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ArgumentEmptyException"/> class.
		/// </summary>
		/// <param name="message">The error message that explains the reason for this exception.</param>
		/// <param name="innerException">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>
		public ArgumentEmptyException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ArgumentEmptyException"/> class.
		/// </summary>
		/// <param name="parameterName">The name of the parameter that caused the exception.</param>
		/// <param name="message">The error message that explains the reason for this exception.</param>
		public ArgumentEmptyException(string parameterName, string message)
			: base(message, parameterName)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ArgumentEmptyException"/> class.
		/// </summary>
		/// <param name="info">The object that holds the serialized object data.</param>
		/// <param name="context">The contextual information about the source or destination.</param>
		[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
		private ArgumentEmptyException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		#endregion
	}
}